<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

    <h1>My first SVG</h1>

    <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
        <circle id="cir" cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
    </svg>

    <script>
        function randomInt(from, to) {
            return parseInt(Math.random() * (to - from + 1) + from);
        }

        let c = document.getElementById("cir");
        setInterval(function() {
            var colorR = randomInt(0, 255);
            var colorG = randomInt(0, 255);
            var colorB = randomInt(0, 255);
            c.setAttribute("fill", "rgb(" + colorR + "," + colorG + "," + colorB + ")")
        }, 600)
    </script>
</body>

</html>